home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / Power.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-15  |  17.7 KB  |  602 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Power.h
  3.  
  4.      Contains:    Power Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.2 on ETO #20
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __POWER__
  21. #define __POWER__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __MIXEDMODE__
  30. #include <MixedMode.h>
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_ALIGN_SUPPORTED
  38. #pragma options align=mac68k
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45.  
  46. enum {
  47. /* Bit positions for ModemByte */
  48.     modemOnBit                    = 0,
  49.     ringWakeUpBit                = 2,
  50.     modemInstalledBit            = 3,
  51.     ringDetectBit                = 4,
  52.     modemOnHookBit                = 5,
  53. /* masks for ModemByte */
  54.     modemOnMask                    = 0x01,
  55.     ringWakeUpMask                = 0x04,
  56.     modemInstalledMask            = 0x08,
  57.     ringDetectMask                = 0x10,
  58.     modemOnHookMask                = 0x20,
  59. /* bit positions for BatteryByte */
  60.     chargerConnBit                = 0,
  61.     hiChargeBit                    = 1,
  62.     chargeOverFlowBit            = 2,
  63.     batteryDeadBit                = 3,
  64.     batteryLowBit                = 4,
  65.     connChangedBit                = 5,
  66. /* masks for BatteryByte */
  67.     chargerConnMask                = 0x01,
  68.     hiChargeMask                = 0x02,
  69.     chargeOverFlowMask            = 0x04,
  70.     batteryDeadMask                = 0x08,
  71.     batteryLowMask                = 0x10,
  72.     connChangedMask                = 0x20
  73. };
  74.  
  75. enum {
  76. /* commands to SleepQRec sleepQProc */
  77.     sleepRequest                = 1,
  78.     sleepDemand                    = 2,
  79.     sleepWakeUp                    = 3,
  80.     sleepRevoke                    = 4,
  81.     sleepUnlock                    = 4,
  82.     sleepDeny                    = 5,
  83.     sleepNow                    = 6,
  84.     dozeDemand                    = 7,
  85.     dozeWakeUp                    = 8,
  86.     dozeRequest                    = 9,
  87. /* SleepQRec.sleepQFlags */
  88.     noCalls                        = 1,
  89.     noRequest                    = 2,
  90.     slpQType                    = 16,
  91.     sleepQType                    = 16
  92. };
  93.  
  94. /* bits in bitfield returned by PMFeatures */
  95. enum {
  96.     hasWakeupTimer                = 0,                            /* 1=wakeup timer is supported                        */
  97.     hasSharedModemPort            = 1,                            /* 1=modem port shared by SCC and internal modem    */
  98.     hasProcessorCycling            = 2,                            /* 1=processor cycling is supported                    */
  99.     mustProcessorCycle            = 3,                            /* 1=processor cycling should not be turned off        */
  100.     hasReducedSpeed                = 4,                            /* 1=processor can be started up at reduced speed    */
  101.     dynamicSpeedChange            = 5,                            /* 1=processor speed can be switched dynamically    */
  102.     hasSCSIDiskMode                = 6,                            /* 1=SCSI Disk Mode is supported                    */
  103.     canGetBatteryTime            = 7,                            /* 1=battery time can be calculated                    */
  104.     canWakeupOnRing                = 8,                            /* 1=can wakeup when the modem detects a ring        */
  105.     hasDimmingSupport            = 9,                            /* 1=has dimming support built in                    */
  106.     hasStartupTimer                = 10                            /* 1=startup timer is supported                        */
  107. };
  108.  
  109. /* bits in bitfield returned by GetIntModemInfo and set by SetIntModemState */
  110. enum {
  111.     hasInternalModem            = 0,                            /* 1=internal modem installed                        */
  112.     intModemRingDetect            = 1,                            /* 1=internal modem has detected a ring                */
  113.     intModemOffHook                = 2,                            /* 1=internal modem is off hook                        */
  114.     intModemRingWakeEnb            = 3,                            /* 1=wakeup on ring is enabled                        */
  115.     extModemSelected            = 4,                            /* 1=external modem selected                        */
  116.     modemSetBit                    = 15                            /* 1=set bit, 0=clear bit (SetIntModemState)        */
  117. };
  118.  
  119. /* bits in BatteryInfo.flags                                     */
  120. /* ("chargerConnected" doesn't mean the charger is plugged in)    */
  121. enum {
  122.     batteryInstalled            = 7,                            /* 1=battery is currently connected                    */
  123.     batteryCharging                = 6,                            /* 1=battery is being charged                        */
  124.     chargerConnected            = 5                                /* 1=charger is connected to the PowerBook            */
  125. };
  126.  
  127. enum {
  128.     HDPwrQType                    = 'HD',                            /* hard disk spindown queue element type            */
  129.     PMgrStateQType                = 'PM'
  130. };
  131.  
  132. /* client notification bits in PMgrQueueElement.pmNotifyBits */
  133. enum {
  134.     pmSleepTimeoutChanged        = 0,
  135.     pmSleepEnableChanged        = 1,
  136.     pmHardDiskTimeoutChanged    = 2,
  137.     pmHardDiskSpindownChanged    = 3,
  138.     pmDimmingTimeoutChanged        = 4,
  139.     pmDimmingEnableChanged        = 5,
  140.     pmDiskModeAddressChanged    = 6,
  141.     pmProcessorCyclingChanged    = 7,
  142.     pmProcessorSpeedChanged        = 8,
  143.     pmWakeupTimerChanged        = 9,
  144.     pmStartupTimerChanged        = 10,
  145.     pmHardDiskPowerRemovedbyUser= 11
  146. };
  147.  
  148. /* System Activity Selectors */
  149. enum {
  150.     OverallAct                    = 0,        /* general type of activity                            */
  151.     UsrActivity                    = 1,        /* user specific type of activity                    */
  152.     NetActivity                    = 2,        /* network specific activity                        */
  153.     HDActivity                    = 3            /* Hard Drive activity                                */
  154. };
  155.  
  156. /* Storage Media sleep mode defines */
  157.  
  158. enum {
  159.     kMediaModeOn                = 0,         /* Media active (Drive spinning and at full power)    */
  160.     kMediaModeStandBy            = 1,         /* Media standby (not implemented)    */
  161.     kMediaModeSuspend            = 2,         /* Media Idle (not implemented)    */
  162.     kMediaModeOff                = 3         /* Media Sleep (Drive not spinning and at min power, max recovery time)    */
  163. };
  164.  
  165. enum { kMediaPowerCSCode = 70 };
  166.  
  167. typedef struct ActivityInfo ActivityInfo;
  168.  
  169. struct ActivityInfo {
  170.     short            ActivityType;            /* Type of activity to be fetched.  Same as UpdateSystemActivity Selectors */    
  171.     unsigned long    ActivityTime;            /* Time of last activity (in ticks) of specified type. */
  172. };
  173.  
  174. typedef struct BatteryInfo BatteryInfo;
  175.  
  176. struct BatteryInfo {
  177.     UInt8                            flags;                        /* misc flags (see below)                            */
  178.     UInt8                            warningLevel;                /* scaled warning level (0-255)                        */
  179.     UInt8                            reserved;                    /* reserved for internal use                        */
  180.     UInt8                            batteryLevel;                /* scaled battery level (0-255)                        */
  181. };
  182. typedef SInt8 ModemByte;
  183.  
  184. typedef SInt8 BatteryByte;
  185.  
  186. typedef long PMResultCode;
  187.  
  188. typedef struct SleepQRec SleepQRec, *SleepQRecPtr;
  189.  
  190. typedef struct HDQueueElement HDQueueElement;
  191.  
  192. typedef struct PMgrQueueElement PMgrQueueElement;
  193.  
  194. /*
  195.         SleepQProcPtr uses register based parameters on the 68k and cannot
  196.         be written in or called from a high-level language without the help of
  197.         mixed mode or assembly glue.
  198.  
  199.             typedef pascal long (*SleepQProcPtr)(long message, SleepQRecPtr qRecPtr);
  200.  
  201.         In:
  202.          => message         D0.L
  203.          => qRecPtr         A0.L
  204.         Out:
  205.          <= return value    D0.L
  206. */
  207. typedef pascal void (*HDSpindownProcPtr)(HDQueueElement *theElement);
  208. typedef pascal void (*PMgrStateChangeProcPtr)(PMgrQueueElement *theElement, long stateBits);
  209.  
  210. #if GENERATINGCFM
  211. typedef UniversalProcPtr SleepQUPP;
  212. typedef UniversalProcPtr HDSpindownUPP;
  213. typedef UniversalProcPtr PMgrStateChangeUPP;
  214. #else
  215. typedef Register68kProcPtr SleepQUPP;
  216. typedef HDSpindownProcPtr HDSpindownUPP;
  217. typedef PMgrStateChangeProcPtr PMgrStateChangeUPP;
  218. #endif
  219.  
  220. struct SleepQRec {
  221.     struct SleepQRec                *sleepQLink;                /* pointer to next queue element                */
  222.     short                            sleepQType;                    /* queue element type (must be SleepQType)        */
  223.     SleepQUPP                        sleepQProc;                    /* pointer to sleep universal proc ptr            */
  224.     short                            sleepQFlags;                /* flags                                        */
  225. };
  226. struct HDQueueElement {
  227.     struct HDQueueElement            *hdQLink;                    /* pointer to next queue element                */
  228.     short                            hdQType;                    /* queue element type (must be HDPwrQType)        */
  229.     short                            hdFlags;                    /* miscellaneous flags                            */
  230.     HDSpindownUPP                    hdProc;                        /* pointer to routine to call                    */
  231.     long                            hdUser;                        /* user-defined (variable storage, etc.)        */
  232. };
  233. struct PMgrQueueElement {
  234.     struct PMgrQueueElement *        pmQLink;                    /* pointer to next queue element                */
  235.     short                             pmQType;                    /* queue element type (must be PMgrStateQType)    */
  236.     short                             pmFlags;                    /* miscellaneous flags                            */
  237.     long                             pmNotifyBits;                /* bitmap of which changes to be notified for    */
  238.     PMgrStateChangeUPP                 pmProc;                        /* pointer to routine to call                    */
  239.     long                             pmUser;                        /* user-defined (variable storage, etc.)        */
  240. };
  241.  
  242. typedef struct BatteryTimeRec BatteryTimeRec;
  243.  
  244. struct BatteryTimeRec {
  245.     unsigned long                    expectedBatteryTime;        /* estimated battery time remaining (seconds)    */
  246.     unsigned long                    minimumBatteryTime;            /* minimum battery time remaining (seconds)        */
  247.     unsigned long                    maximumBatteryTime;            /* maximum battery time remaining (seconds)        */
  248.     unsigned long                    timeUntilCharged;            /* time until battery is fully charged (seconds)*/
  249. };
  250. typedef struct WakeupTime WakeupTime;
  251.  
  252. struct WakeupTime {
  253.     unsigned long                    wakeTime;                    /* wakeup time (same format as current time)        */
  254.     Boolean                            wakeEnabled;                /* 1=enable wakeup timer, 0=disable wakeup timer    */
  255.     SInt8                            filler;
  256. };
  257. typedef struct StartupTime StartupTime;
  258.  
  259. struct StartupTime {
  260.     unsigned long                    startTime;                    /* startup time (same format as current time)        */
  261.     Boolean                            startEnabled;                /* 1=enable startup timer, 0=disable startup timer    */
  262.     SInt8                            filler;
  263. };
  264. extern pascal OSErr DisableWUTime(void);
  265. extern pascal OSErr SetWUTime(long WUTime);
  266. extern pascal OSErr GetWUTime(long *WUTime, Byte *WUFlag);
  267. extern pascal OSErr BatteryStatus(Byte *Status, Byte *Power);
  268. extern pascal OSErr ModemStatus(Byte *Status);
  269.  
  270. #if !GENERATINGCFM
  271. #pragma parameter __D0 IdleUpdate
  272. #endif
  273. extern pascal long IdleUpdate(void)
  274.  ONEWORDINLINE(0xA285);
  275.  
  276. #if !GENERATINGCFM
  277. #pragma parameter __D0 GetCPUSpeed
  278. #endif
  279. extern pascal long GetCPUSpeed(void)
  280.  TWOWORDINLINE(0x70FF, 0xA485);
  281. extern pascal void EnableIdle(void)
  282.  TWOWORDINLINE(0x7000, 0xA485);
  283. extern pascal void DisableIdle(void)
  284.  TWOWORDINLINE(0x7001, 0xA485);
  285.  
  286. #if !GENERATINGCFM
  287. #pragma parameter SleepQInstall(__A0)
  288. #endif
  289. extern pascal void SleepQInstall(SleepQRecPtr qRecPtr)
  290.  ONEWORDINLINE(0xA28A);
  291.  
  292. #if !GENERATINGCFM
  293. #pragma parameter SleepQRemove(__A0)
  294. #endif
  295. extern pascal void SleepQRemove(SleepQRecPtr qRecPtr)
  296.  ONEWORDINLINE(0xA48A);
  297. extern pascal void AOn(void)
  298.  TWOWORDINLINE(0x7004, 0xA685);
  299. extern pascal void AOnIgnoreModem(void)
  300.  TWOWORDINLINE(0x7005, 0xA685);
  301. extern pascal void BOn(void)
  302.  TWOWORDINLINE(0x7000, 0xA685);
  303. extern pascal void AOff(void)
  304.  TWOWORDINLINE(0x7084, 0xA685);
  305. extern pascal void BOff(void)
  306.  TWOWORDINLINE(0x7080, 0xA685);
  307. /* Public Power Management API (NEW!) */
  308.  
  309. #if !GENERATINGCFM
  310. #pragma parameter __D0 PMSelectorCount
  311. #endif
  312. extern pascal short PMSelectorCount(void)
  313.  TWOWORDINLINE(0x7000, 0xA09E);
  314.  
  315. #if !GENERATINGCFM
  316. #pragma parameter __D0 PMFeatures
  317. #endif
  318. extern pascal unsigned long PMFeatures(void)
  319.  TWOWORDINLINE(0x7001, 0xA09E);
  320.  
  321. #if !GENERATINGCFM
  322. #pragma parameter __D0 GetSleepTimeout
  323. #endif
  324. extern pascal UInt8 GetSleepTimeout(void)
  325.  TWOWORDINLINE(0x7002, 0xA09E);
  326.  
  327. #if !GENERATINGCFM
  328. #pragma parameter SetSleepTimeout(__D0)
  329. #endif
  330. extern pascal void SetSleepTimeout(UInt8 timeout)
  331.  FOURWORDINLINE(0x4840, 0x303C, 0x0003, 0xA09E);
  332.  
  333. #if !GENERATINGCFM
  334. #pragma parameter __D0 GetHardDiskTimeout
  335. #endif
  336. extern pascal UInt8 GetHardDiskTimeout(void)
  337.  TWOWORDINLINE(0x7004, 0xA09E);
  338.  
  339. #if !GENERATINGCFM
  340. #pragma parameter SetHardDiskTimeout(__D0)
  341. #endif
  342. extern pascal void SetHardDiskTimeout(UInt8 timeout)
  343.  FOURWORDINLINE(0x4840, 0x303C, 0x0005, 0xA09E);
  344.  
  345. #if !GENERATINGCFM
  346. #pragma parameter __D0 HardDiskPowered
  347. #endif
  348. extern pascal Boolean HardDiskPowered(void)
  349.  TWOWORDINLINE(0x7006, 0xA09E);
  350.  
  351. #if !GENERATINGCFM
  352. #pragma parameter SpinDownHardDisk
  353. #endif
  354. extern pascal void SpinDownHardDisk(void)
  355.  TWOWORDINLINE(0x7007, 0xA09E);
  356.  
  357. #if !GENERATINGCFM
  358. #pragma parameter __D0 IsSpindownDisabled
  359. #endif
  360. extern pascal Boolean IsSpindownDisabled(void)
  361.  TWOWORDINLINE(0x7008, 0xA09E);
  362.  
  363. #if !GENERATINGCFM
  364. #pragma parameter SetSpindownDisable(__D0)
  365. #endif
  366. extern pascal void SetSpindownDisable(Boolean setDisable)
  367.  FOURWORDINLINE(0x4840, 0x303C, 0x0009, 0xA09E);
  368.  
  369. #if !GENERATINGCFM
  370. #pragma parameter __D0 HardDiskQInstall(__A0)
  371. #endif
  372. extern pascal OSErr HardDiskQInstall(HDQueueElement *theElement)
  373.  TWOWORDINLINE(0x700A, 0xA09E);
  374.  
  375. #if !GENERATINGCFM
  376. #pragma parameter __D0 HardDiskQRemove(__A0)
  377. #endif
  378. extern pascal OSErr HardDiskQRemove(HDQueueElement *theElement)
  379.  TWOWORDINLINE(0x700B, 0xA09E);
  380.  
  381. #if !GENERATINGCFM
  382. #pragma parameter GetScaledBatteryInfo(__D0, __A0)
  383. #endif
  384. extern pascal void GetScaledBatteryInfo(short whichBattery, BatteryInfo *theInfo)
  385.  FIVEWORDINLINE(0x4840, 0x303C, 0x000C, 0xA09E, 0x2080);
  386.  
  387. #if !GENERATINGCFM
  388. #pragma parameter AutoSleepControl(__D0)
  389. #endif
  390. extern pascal void AutoSleepControl(Boolean enableSleep)
  391.  FOURWORDINLINE(0x4840, 0x303C, 0x000D, 0xA09E);
  392.  
  393. #if !GENERATINGCFM
  394. #pragma parameter __D0 GetIntModemInfo
  395. #endif
  396. extern pascal unsigned long GetIntModemInfo(void)
  397.  TWOWORDINLINE(0x700E, 0xA09E);
  398.  
  399. #if !GENERATINGCFM
  400. #pragma parameter SetIntModemState(__D0)
  401. #endif
  402. extern pascal void SetIntModemState(short theState)
  403.  FOURWORDINLINE(0x4840, 0x303C, 0x000F, 0xA09E);
  404.  
  405. #if !GENERATINGCFM
  406. #pragma parameter __D0 MaximumProcessorSpeed
  407. #endif
  408. extern pascal short MaximumProcessorSpeed(void)
  409.  TWOWORDINLINE(0x7010, 0xA09E);
  410.  
  411. #if !GENERATINGCFM
  412. #pragma parameter __D0 CurrentProcessorSpeed
  413. #endif
  414. extern pascal short CurrentProcessorSpeed(void)
  415.  TWOWORDINLINE(0x7011, 0xA09E);
  416.  
  417. #if !GENERATINGCFM
  418. #pragma parameter __D0 FullProcessorSpeed
  419. #endif
  420. extern pascal Boolean FullProcessorSpeed(void)
  421.  TWOWORDINLINE(0x7012, 0xA09E);
  422.  
  423. #if !GENERATINGCFM
  424. #pragma parameter __D0 SetProcessorSpeed(__D0)
  425. #endif
  426. extern pascal Boolean SetProcessorSpeed(Boolean fullSpeed)
  427.  FOURWORDINLINE(0x4840, 0x303C, 0x0013, 0xA09E);
  428.  
  429. #if !GENERATINGCFM
  430. #pragma parameter __D0 GetSCSIDiskModeAddress
  431. #endif
  432. extern pascal short GetSCSIDiskModeAddress(void)
  433.  TWOWORDINLINE(0x7014, 0xA09E);
  434.  
  435. #if !GENERATINGCFM
  436. #pragma parameter SetSCSIDiskModeAddress(__D0)
  437. #endif
  438. extern pascal void SetSCSIDiskModeAddress(short scsiAddress)
  439.  FOURWORDINLINE(0x4840, 0x303C, 0x0015, 0xA09E);
  440.  
  441. #if !GENERATINGCFM
  442. #pragma parameter GetWakeupTimer(__A0)
  443. #endif
  444. extern pascal void GetWakeupTimer(WakeupTime *theTime)
  445.  TWOWORDINLINE(0x7016, 0xA09E);
  446.  
  447. #if !GENERATINGCFM
  448. #pragma parameter SetWakeupTimer(__A0)
  449. #endif
  450. extern pascal void SetWakeupTimer(WakeupTime *theTime)
  451.  TWOWORDINLINE(0x7017, 0xA09E);
  452.  
  453. #if !GENERATINGCFM
  454. #pragma parameter __D0 IsProcessorCyclingEnabled
  455. #endif
  456. extern pascal Boolean IsProcessorCyclingEnabled(void)
  457.  TWOWORDINLINE(0x7018, 0xA09E);
  458.  
  459. #if !GENERATINGCFM
  460. #pragma parameter EnableProcessorCycling(__D0)
  461. #endif
  462. extern pascal void EnableProcessorCycling(Boolean enable)
  463.  FOURWORDINLINE(0x4840, 0x303C, 0x0019, 0xA09E);
  464.  
  465. #if !GENERATINGCFM
  466. #pragma parameter __D0 BatteryCount
  467. #endif
  468. extern pascal short BatteryCount(void)
  469.  TWOWORDINLINE(0x701A, 0xA09E);
  470.  
  471. #if !GENERATINGCFM
  472. #pragma parameter __D0 GetBatteryVoltage(__D0)
  473. #endif
  474. extern pascal Fixed GetBatteryVoltage(short whichBattery)
  475.  FOURWORDINLINE(0x4840, 0x303C, 0x001B, 0xA09E);
  476.  
  477. #if !GENERATINGCFM
  478. #pragma parameter GetBatteryTimes(__D0, __A0)
  479. #endif
  480. extern pascal void GetBatteryTimes(short whichBattery, BatteryTimeRec *theTimes)
  481.  FOURWORDINLINE(0x4840, 0x303C, 0x001C, 0xA09E);
  482.  
  483. #if !GENERATINGCFM
  484. #pragma parameter __D0 GetDimmingTimeout
  485. #endif
  486. extern pascal UInt8 GetDimmingTimeout(void)
  487.  TWOWORDINLINE(0x701D, 0xA09E);
  488.  
  489. #if !GENERATINGCFM
  490. #pragma parameter SetDimmingTimeout(__D0)
  491. #endif
  492. extern pascal void SetDimmingTimeout(UInt8 timeout)
  493.  FOURWORDINLINE(0x4840, 0x303C, 0x001E, 0xA09E);
  494.  
  495. #if !GENERATINGCFM
  496. #pragma parameter DimmingControl(__D0)
  497. #endif
  498. extern pascal void DimmingControl(Boolean enableSleep)
  499.  FOURWORDINLINE(0x4840, 0x303C, 0x001F, 0xA09E);
  500.  
  501. #if !GENERATINGCFM
  502. #pragma parameter __D0 IsDimmingControlDisabled
  503. #endif
  504. extern pascal Boolean IsDimmingControlDisabled(void)
  505.  TWOWORDINLINE(0x7020, 0xA09E);
  506.  
  507. #if !GENERATINGCFM
  508. #pragma parameter __D0 IsAutoSlpControlDisabled
  509. #endif
  510. extern pascal Boolean IsAutoSlpControlDisabled(void)
  511.  TWOWORDINLINE(0x7021, 0xA09E);
  512.  
  513. #if !GENERATINGCFM
  514. #pragma parameter __D0 PMgrStateQInstall(__A0)
  515. #endif
  516. extern pascal OSErr PMgrStateQInstall(PMgrQueueElement *theElement)
  517.  TWOWORDINLINE(0x7022, 0xA09E);
  518.  
  519. #if !GENERATINGCFM
  520. #pragma parameter __D0 PMgrStateQRemove(__A0)
  521. #endif
  522. extern pascal OSErr PMgrStateQRemove(PMgrQueueElement *theElement)
  523.  TWOWORDINLINE(0x7023, 0xA09E);
  524.  
  525. #if !GENERATINGCFM
  526. #pragma parameter __D0 UpdateSystemActivity(__D0)
  527. #endif
  528. extern pascal OSErr UpdateSystemActivity(UInt8 activity)
  529.  FOURWORDINLINE(0x4840, 0x303C, 0x0024, 0xA09E);
  530.  
  531. #if !GENERATINGCFM
  532. #pragma parameter __D0 DelaySystemIdle
  533. #endif
  534. extern pascal OSErr DelaySystemIdle(void )
  535.  TWOWORDINLINE(0x7025, 0xA09E);
  536.  
  537. #if !GENERATINGCFM
  538. #pragma parameter __D0 GetStartupTimer(__A0)
  539. #endif
  540. extern pascal OSErr GetStartupTimer(StartupTime *theTime)
  541.  TWOWORDINLINE(0x7026, 0xA09E);
  542.  
  543. #if !GENERATINGCFM
  544. #pragma parameter __D0 SetStartupTimer(__A0)
  545. #endif
  546. extern pascal OSErr SetStartupTimer(StartupTime *theTime)
  547.  TWOWORDINLINE(0x7027, 0xA09E);
  548.  
  549. #if !GENERATINGCFM
  550. #pragma parameter __D0 GetLastActivity(__A0)
  551. #endif
  552. extern pascal OSErr GetLastActivity(ActivityInfo *theActivity)
  553.  TWOWORDINLINE(0x7028, 0xA09E);
  554.  
  555. enum {
  556.     uppSleepQProcInfo = kRegisterBased
  557.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  558.          | REGISTER_RESULT_LOCATION(kRegisterD0)
  559.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(long)))
  560.          | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(SleepQRecPtr))),
  561.     uppHDSpindownProcInfo = kPascalStackBased
  562.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(HDQueueElement*)))
  563. };
  564.  
  565. #if GENERATINGCFM
  566. #define NewSleepQProc(userRoutine)        \
  567.         (SleepQUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppSleepQProcInfo, GetCurrentArchitecture())
  568. #define NewHDSpindownProc(userRoutine)        \
  569.         (HDSpindownUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppHDSpindownProcInfo, GetCurrentArchitecture())
  570. #else
  571. #define NewSleepQProc(userRoutine)        \
  572.         ((SleepQUPP) (userRoutine))
  573. #define NewHDSpindownProc(userRoutine)        \
  574.         ((HDSpindownUPP) (userRoutine))
  575. #endif
  576.  
  577. #if GENERATINGCFM
  578. #define CallSleepQProc(userRoutine, message, qRecPtr)        \
  579.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppSleepQProcInfo, (message), (qRecPtr))
  580. #define CallHDSpindownProc(userRoutine, theElement)        \
  581.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppHDSpindownProcInfo, (theElement))
  582. #else
  583. /* (*SleepQProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  584. #define CallHDSpindownProc(userRoutine, theElement)        \
  585.         (*(userRoutine))((theElement))
  586. #endif
  587.  
  588.  
  589. #if PRAGMA_IMPORT_SUPPORTED
  590. #pragma import off
  591. #endif
  592.  
  593. #if PRAGMA_ALIGN_SUPPORTED
  594. #pragma options align=reset
  595. #endif
  596.  
  597. #ifdef __cplusplus
  598. }
  599. #endif
  600.  
  601. #endif /* __POWER__ */
  602.